﻿using System;

namespace DMS.Web.Common.Controls
{
    public partial class FlowTrackingInfo : System.Web.UI.UserControl
    {
        private string _type = null;

        public string InstanceId { get; set; }

        public string ExtendStr { get; set; }

        public string TrackInfoType 
        { 
            get { return _type; } 
            set
            {
                string[] types = value.Trim().Split(';');
                string headStr = " and (wType in (";
                string allTypeStr = "";
                string nullType = "";
                foreach (string typeStr in types)
                {
                    if (typeStr == "null")
                        nullType = " or wType is null";
                    else
                    {
                        allTypeStr += "'" + typeStr + "',";
                    }
                }

                if(string.IsNullOrEmpty(allTypeStr))
                {
                    this._type = "";
                }
                else
                {
                    this._type = headStr + allTypeStr.Substring(0, allTypeStr.Length - 1) + ") " + nullType +")";
                }
            } 
        }

        private string _params = null;
        public string Params
        {
            get { return _params; }
            set { this._params = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}